package com.khh.action;

import com.khh.dao.StudentDao;
import com.khh.entity.Student;
import com.opensymphony.xwork2.ActionContext;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * Created by webrx on 2017-09-15.
 */
@Data
@Repository
public class StudentAction {

    @Autowired
    private StudentDao dao;

    public void query(){
        //传值
        //ActionContext.getContext().put("book",dao.query());
        //dao.query();
        System.out.println(dao.query().size());
    }

    public void insert(){
        Student stu = new Student();
        stu.setName("天天");
        stu.setScore(66);
        dao.insert(stu);
    }

}
